# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Thomas Weißschuh <thomas t-8ch de>

pkgname=python-hid
pkgver=1.0.4
pkgrel=8
_pkgname=${pkgname#python-}
pkgdesc="Python hidapi bindings in ctypes (aka pyhidapi)"
arch=(any)
url="https://github.com/apmorton/pyhidapi"
license=(MIT)
depends=(hidapi python)
conflicts=(python-hidapi)
makedepends=(python-setuptools)
source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha256sums=('f61b0382f37a334bc8ba8604bc84b94875ee4f594fbbaf82b2c3b3e827883fc1')

build() {
  cd "$_pkgname-$pkgver"
  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"
  python setup.py install --skip-build -O1 --root="$pkgdir"
}
